﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Enumerations
{
    class Program
    {
        static void Main(string[] args)
        {

            string value = "Gold";
            bool ignoreCase = true;
            //parsing string to enum
            Metal metal = (Metal)Enum.Parse(typeof(Metal), value, ignoreCase);

            Console.WriteLine("metal == Metal.Silver -> {0}", metal == Metal.Silver);
            Console.WriteLine("metal == Metal.Gold -> {0}", metal == Metal.Gold);
            Console.ReadLine();
        }
    }

    public enum Metal
    {
        Unknown =0,
        Gold =1,
        Silver = 2,
        Copper = 3
    }
}
